package com.itliang.service.hardware.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.itliang.core.model.entity.equipment.Statistics;
import com.itliang.exception.BusinessException;
import com.itliang.mapper.hardware.StatisticsMapper;
import com.itliang.service.hardware.EquipmentDataService;
import com.itliang.service.hardware.StatisticsService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @author mofish
 * @description 针对表【statistics(统计表)】的数据库操作Service实现
 * @createDate 2023-05-06 04:06:19
 */
@Service
public class StatisticsServiceImpl extends ServiceImpl<StatisticsMapper, Statistics>
        implements StatisticsService {

    @Resource
    private StatisticsMapper statisticsMapper;

    @Resource
    private EquipmentDataService equipmentDataService;

    @Override
    public void addStatisticsData(Statistics statistics) {
        if (statistics == null) {
            // TODO 自定义返回异常
            throw new BusinessException(4446223, "无法生成，请重新选择！");
        }

        this.save(statistics);
    }
}




